package com.hy.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Param;

import com.hy.admin.pojo.RegistrationGrowth;
import com.hy.admin.pojo.RegistrationInfo;
import com.hy.admin.pojo.UserActivity;

import java.util.List;

/**
* @author Lenovo
* @description 针对表【user_activity(存储医生和患者在不同时间的活跃度占比信息)】的数据库操作Mapper
* @createDate 2025-03-05 15:36:27
* @Entity com.hy.admin.pojo.UserActivity
*/
@Mapper
public interface UserActivityMapper extends BaseMapper<UserActivity> {
    /**
     * 查询最近6个月的注册信息
     */
    List<RegistrationInfo> selectRegistrationInfos();

    /**
     * 统计各类型用户数量
     */
    @Select("SELECT COUNT(*) FROM user WHERE user_type = #{userType}")
    Integer countUsersByType(@Param("userType") Integer userType);

    /**
     * 查询最近6个月的用户活跃度
     */
    List<UserActivity> selectUserActivities();

    /**
     * 查询最近6个月的注册增长数据
     */
    List<RegistrationGrowth> selectRegistrationGrowths();
}




